package cn.tedu.baidashi.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author tedu.cn
 * @since 2022-02-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("orders")
public class Orders implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 订单号
     */
    @TableField("order_no")
    private Long orderNo;

    /**
     * 用户id
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 收件人姓名
     */
    @TableField("receiver_name")
    private String receiverName;

    /**
     * 省
     */
    @TableField("receiver_province")
    private String receiverProvince;

    /**
     * 市
     */
    @TableField("receiver_city")
    private String receiverCity;

    /**
     * 区县
     */
    @TableField("receiver_district")
    private String receiverDistrict;

    /**
     * 街道
     */
    @TableField("receiver_street")
    private String receiverStreet;

    /**
     * 电话
     */
    @TableField("receiver_phone")
    private String receiverPhone;

    /**
     * 实际付款金额,单位是元,保留两位小数
     */
    @TableField("order_total")
    private BigDecimal orderTotal;

    /**
     * 支付类型,1-支付宝
     */
    @TableField("payment_type")
    private Integer paymentType;

    /**
     * 订单状态:10-未付款，20-已付款，40-已发货，50-交易成功，60-交易关闭
     */
    @TableField("status")
    private Integer status;

    /**
     * 支付时间
     */
    @TableField("payment_time")
    private LocalDateTime paymentTime;

    /**
     * 发货时间
     */
    @TableField("send_time")
    private LocalDateTime sendTime;

    /**
     * 交易完成时间
     */
    @TableField("end_time")
    private LocalDateTime endTime;

    /**
     * 交易关闭时间
     */
    @TableField("close_time")
    private LocalDateTime closeTime;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    // 订单产品列表
    @TableField(exist = false)
    private List<OrderItems> orderItems=new ArrayList<>();


}
